package com.yunhe.control;

import java.io.IOException;
import java.io.InputStream;
import java.util.List;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.ibatis.io.Resources;
import org.apache.ibatis.session.SqlSession;
import org.apache.ibatis.session.SqlSessionFactory;
import org.apache.ibatis.session.SqlSessionFactoryBuilder;

import com.yunhe.bean.Board;
import com.yunhe.bean.ShopImfor;
import com.yunhe.service.GoodsBoardService;
import com.yunhe.util.MySession;

/**
 * Servlet implementation class deleteBoard
 */
/*@WebServlet(name = "deleteBoard.do", urlPatterns = { "/deleteBoard.do" })*/
@WebServlet("/deleteBoard.do")
public class deleteBoard extends HttpServlet {
	private static final long serialVersionUID = 1L;
       
    /**
     * @see HttpServlet#HttpServlet()
     */
    public deleteBoard() {
        super();
        // TODO Auto-generated constructor stub
    }

	/**
	 * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response)
	 */
	protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		doPost(request,response);
	}

	/**
	 * @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response)
	 */
	protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		String bid = request.getParameter("bid");
		//Board b = new Board(Integer.parseInt(bid));
		Board b = new Board();
		b.setBid(Integer.parseInt(bid));
		System.out.println("删除版块:"+bid);
		GoodsBoardService gb=new GoodsBoardService();
		gb.deleteBoard(b);
	}

}
